import {DEPARTMENTS_REQUEST,DEPARTMENTS_RECEIVE} from "../actions"
import { createReducer } from 'redux-immutablejs'
import Immutable from 'Immutable'




const initialState = Immutable.fromJS({ isFetching: true,items:[] })



export default createReducer(initialState,{
  [DEPARTMENTS_RECEIVE]:(state,action) => state.merge({
    items:action.items,
    isFetching:false
  }),
  [DEPARTMENTS_REQUEST]:(state,action) => state.merge({
    isFetching:true
  }),




})
